package ProjectXXX;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.border.TitledBorder;
import java.util.Vector;


public class PrintReportPanelVersion2 extends JPanel
{
	//attributes
	private JPanel basePanel = null,southBasePanel = null,centerBasePanel = null,
	               reportChoosePanel = null,reportPanel = null,reportSubPanel = null;
	               
	private Box reportBox = null;            
	               
	private JButton displayBut = null,printBut = null;
              
    private JLabel reportPanelLabel = null;           
               
	private JLabel generalLabel = null;
	                          
	private JTextArea reportJTA = null;
	private JScrollPane jsp = null;
	
	private JComboBox reportJCB = null;
	private Vector reportVect; 
	private JLabel reportChooseLabel = null;
	
	private JTextField fromDateJTF = null,toDateJTF = null;
	private JButton toCalender = null,fromCalender = null;
	
	private JFrame testFrame;
	
	//colours & FOnts
	private Font butFont;
	private Font mainLabelFont;
	private Color customColour;
	
	//constructor
	public PrintReportPanelVersion2()
	{
	    //colours & fonts
	    butFont = new Font("ButtonFont",Font.BOLD,15);
		mainLabelFont = new Font("MainFont",Font.BOLD,40);
		customColour = Color.blue;
		Dimension dim = new Dimension(Short.MAX_VALUE,30);
		Dimension dimBut = new Dimension(Short.MAX_VALUE,50);
			
			
		reportChoosePanel = new JPanel();
		BoxLayout reportLayout = new BoxLayout(reportChoosePanel,BoxLayout.Y_AXIS);
		reportChoosePanel.setLayout(reportLayout);
		reportChooseLabel = new JLabel("Select Report");
        reportVect = new Vector();
        reportVect.addElement("<SELECT REPORT>");
        reportVect.addElement("TOTAL SALES");
        reportVect.addElement("TOTAL RENTALS");
        reportVect.addElement("TOP 10 RESOURCES");
        reportVect.addElement("TOP 10 CUSTOMERS");
        reportVect.addElement("Old Stock");
		reportJCB = new JComboBox(reportVect);
		reportJCB.setMaximumSize(dim);
		reportChoosePanel.add(reportJCB);
		fromDateJTF = new JTextField("Date From",20);
		fromDateJTF.setMaximumSize(dim);
		toDateJTF = new JTextField("Date To",20);
		toDateJTF.setMaximumSize(dim);
		toCalender = new JButton("To Date");
		toCalender.setMaximumSize(new Dimension(600,30));
		fromCalender = new JButton("From Date");
		fromCalender.setMaximumSize(new Dimension(600,30));
		reportChoosePanel.add(fromDateJTF);
		reportChoosePanel.add(toCalender);
		reportChoosePanel.add(toDateJTF);
		reportChoosePanel.add(fromCalender);
		reportSubPanel = new JPanel(new GridLayout(1,1));
		reportSubPanel.add(reportChooseLabel);
		reportSubPanel.add(reportChoosePanel);

		
		reportJTA = new JTextArea();
		reportJTA.setRows(20);
		reportJTA.setColumns(20);
		jsp = new JScrollPane(reportJTA,ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
		reportPanelLabel = new JLabel("Report :");
		reportJTA.setEditable(false);
		reportPanel = new JPanel(new GridLayout(1,1));
		reportPanel.setBorder(BorderFactory.createEmptyBorder(30,30,20,0));
		//reportPanel.add(reportPanelLabel);
		reportPanel.add(jsp);
		//reportPanel.setBorder(BorderFactory.createEtchedBorder(Color.blue,Color.black));
		centerBasePanel = new JPanel(new BorderLayout());
		centerBasePanel.add(reportPanel,BorderLayout.CENTER);
		centerBasePanel.add(reportSubPanel,BorderLayout.WEST);
	
		//southBasePanel
		printBut = new JButton("PRINT");
		printBut.setBorder(BorderFactory.createRaisedBevelBorder());
		printBut.setFont(butFont);
		printBut.setForeground(customColour);
		displayBut = new JButton("DISPLAY");
		displayBut.setBorder(BorderFactory.createRaisedBevelBorder());
		displayBut.setFont(butFont);
		displayBut.setForeground(customColour);
		
		southBasePanel = new JPanel();
		southBasePanel.add(displayBut);
		southBasePanel.add(printBut);
		
	    //main Base Panel
		basePanel = new JPanel();
		 BoxLayout b1 = new BoxLayout(basePanel,BoxLayout.X_AXIS);
		basePanel.setLayout(b1);
		//basePanel.add(pageLabel,BorderLayout.NORTH);
		basePanel.add(centerBasePanel);
	//	basePanel.add(southBasePanel,BorderLayout.SOUTH);
		basePanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(Color.white,Color.blue),"REPORT PAGE"));
		                    
		
		//setup This panel
		this.setLayout(new GridLayout(1,1));
		this.add(basePanel);
		
		//testFrame
		testFrame = new JFrame();
		testFrame.getContentPane();
		testFrame.add(this);
		testFrame.setSize(800,600);
		testFrame.setVisible(true);
		
		
	}//end constructor
	
	
	public static void main(String [ ] args)
	{
		new PrintReportPanelVersion2();
	}
	
}//end PrintReportPanel